graph drop _all 

set scheme s1mono

use "$data/incFinalMonthlyTehsil", clear

drop if dist=="swa" //Remove SWA data

//Aggregate data by half-year and treatment status
collapse (sum) incidents totCas (max) treat, by(yhy nwa)

drop if nwa==.

//Put data into graphable format
reshape wide incidents totCas treat, i(yhy) j(nwa)

//Output plots for use in Figure 3.
binscatter incidents0 yhy, n(40) by(treat1) legend(off) xline(96, lp(shortdash)) ytitle("") xtitle("") ylabel(, angle(0) labsize(vlarge)) name(inc0) xlabel(86 "2003" 88 "2004" 90 "2005" 92 "2006" 94 "2007" 96 "2008" 98 "2009" 100 "2010" 102 "2011" 104 "2012", angle(45) labsize(vlarge))
gr export "$figures/incHyrBin0.pdf", replace
binscatter incidents1 yhy, n(40) by(treat1) legend(off) xline(96, lp(shortdash)) ytitle("") xtitle("") ylabel(, angle(0) labsize(vlarge)) name(inc1) xlabel(86 "2003" 88 "2004" 90 "2005" 92 "2006" 94 "2007" 96 "2008" 98 "2009" 100 "2010" 102 "2011" 104 "2012", angle(45) labsize(vlarge))
gr export "$figures/incHyrBin1.pdf", replace

binscatter totCas0 yhy, n(40) by(treat1) legend(off) xline(96, lp(shortdash)) ytitle("") xtitle("") ylabel(, angle(0) labsize(vlarge)) name(cas0) xlabel(86 "2003" 88 "2004" 90 "2005" 92 "2006" 94 "2007" 96 "2008" 98 "2009" 100 "2010" 102 "2011" 104 "2012", angle(45) labsize(vlarge))
gr export "$figures/casHyrBin0.pdf", replace
binscatter totCas1 yhy, n(40) by(treat1) legend(off) xline(96, lp(shortdash)) ytitle("") xtitle("") ylabel(, angle(0) labsize(vlarge)) name(cas1) xlabel(86 "2003" 88 "2004" 90 "2005" 92 "2006" 94 "2007" 96 "2008" 98 "2009" 100 "2010" 102 "2011" 104 "2012", angle(45) labsize(vlarge))
gr export "$figures/casHyrBin1.pdf", replace
